package ace.module.account.core.impl.api.impl;

import ace.cmp.core.model.R;
import ace.module.account.api.IamAccountPasswordApi;
import ace.module.account.api.model.dto.IamAccountPasswordDto;
import ace.module.account.core.impl.dao.entity.IamAccountPassword;
import ace.module.account.core.impl.manager.IamAccountPasswordManager;
import ace.module.account.core.impl.service.IamAccountPasswordService;
import ace.module.common.api.annotation.ApiLocalPriority;
import ace.module.common.core.impl.api.impl.SdkApiImpl;
import java.util.List;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Component;


/**
 * 账户的密码 api implements.
 *
 * @author Caspar
 *
 */
@ApiLocalPriority
@AllArgsConstructor
@Component
public class IamAccountPasswordApiImpl
    extends SdkApiImpl<IamAccountPassword, Long, IamAccountPasswordDto, IamAccountPasswordManager>
    implements IamAccountPasswordApi {

  private final IamAccountPasswordService iamAccountPasswordService;

  @Override
  public R<List<IamAccountPasswordDto>> getByIamAppIdAndPassportAndPassportTypes(Long iamAppId, String passport, List<Integer> passportTypes) {
    List<IamAccountPasswordDto> result = iamAccountPasswordService.getByIamAppIdAndPassportAndPassportTypes(iamAppId, passport, passportTypes);
    return R.ok(result);
  }
}
